home *** CD-ROM | disk | FTP | other *** search
/ 3D Images / 3D Images.iso / programs / amiga / batchfactory / scripts / imagemaster / im_images_to_solarization < prev   
Encoding:
Text File  |  1995-01-12  |  2.3 KB  |  96 lines

  1. /* 
  2.                     IMAGE MASTER IMAGES TO SOLARIZATION
  3.                                By J.L. White
  4.                           ©1994 Merlin's Software
  5.  
  6.                             Image Master Script
  7.  
  8.  Batch Factory Batch Conversion Scripts are basically Arexx scripts that
  9. allow you to pass certain parameters to the external program you wish
  10. to use to convert the images from one format to another. You can pass
  11. five different strings from Batch Factory to the script by using the
  12. following commands:
  13.  
  14. $N = This will pass the current selected filename.
  15. $P = This will tell Batch Factory to ask for a path to save new frames to.
  16. $# = This will pass the current frame number in the script.
  17. $T = This will pass the total number of frames in the script.
  18. $A = This will pass an offset number to be used to save frames with.
  19.  
  20. NOTE: The following line is required to work as a Batch Factory Script:
  21.  
  22. PARSE=$N $P $# $A $T
  23.  
  24. */
  25.  
  26. arg TheFile OutFile FrameNum AddNum TotalNum
  27. SaveNum = FrameNum + AddNum
  28. options results
  29.  
  30. call Locate_IM
  31.  
  32. address 'IM_Port'
  33. Buffers
  34. parse var result Name','Num','Fluff 
  35. if Num = 0 then Killbuff 0
  36. Path = GetPathName(TheFile)
  37. Pic = GetFileName(TheFile)
  38. if FrameNum = 1 then do
  39.     IMToFront
  40.     ImagePath Path
  41.     LoadAsPrimary Pic
  42.     'Gadgets "Do Operation On" "Entire Image",
  43.     "Do Operation On" "Selected Area"';
  44.     Selection = result;
  45.     if Selection = 1 then do
  46.         'entire'
  47.         end
  48.     if Selection = 2 then do
  49.         'area'
  50.         end
  51.     'SaveMask Ram:TempMaskSOL'
  52.     end
  53. else do
  54.     ImagePath Path
  55.     LoadAsPrimary Pic
  56.     'LoadMask Ram:TempMaskSOL 1'
  57.     end
  58. if OutFile = "SAME" then do
  59.     Path = GetPathName(TheFile)
  60.     Pic = GetFileName(TheFile)
  61.     end
  62. else do
  63.     Path = GetPathName(OutFile)
  64.     Pic = GetFileName(OutFile)""right(SaveNum,3,'0')
  65.     end
  66. Solar
  67. Rename 0 Pic
  68. ImagePath Path
  69. Save 0
  70. if FrameNum = TotalNum then do
  71.     address command "delete >NIL: Ram:TempMaskSOL"
  72.     end
  73. Exit
  74.  
  75.  
  76. GetFileName: procedure  
  77.    ARG CompleteName
  78.    c = lastpos("/",CompleteName)
  79.    if c = 0 then c = lastpos(":",CompleteName)
  80.    return substr(CompleteName, c + 1)
  81.  
  82. GetPathName: procedure  
  83.    ARG CompleteName
  84.    c = lastpos("/",CompleteName)
  85.    if c = 0 then c = lastpos(":",CompleteName)
  86.    return left(CompleteName,c)
  87.  
  88. Locate_IM:
  89.     if (POS('IM_Port',SHOW('Ports')) = 0)
  90.     then do
  91.         address command 'run < nil: > nil: IMIMIM:IMF'
  92.         address command 'wait 10'
  93.     end
  94. return
  95.  
  96.